package Modal;

public class HualianStyle implements Style{
    @Override
    public String transToString(Sale sale) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("----------华联超市----------\n");
        stringBuilder.append("品名\t零售价\t数量\t金额\n");
        for (SaleLineItem item : sale.getLineItems()) {
            stringBuilder.append(item.toString()).append("\n");
        }
        stringBuilder.append("应付额：").append(sale.getTotal()).append("\n");
        stringBuilder.append("实付额：").append(sale.getPay().getCash()).append("\n");
        stringBuilder.append("找零：").append(sale.getBalance()).append("\n");
        return stringBuilder.toString();
    }
}
